<template>
    <MyContent
      :resData="resData"
      :config="config"
      :totalNumber="totalNumber"
      :pageSize="pageSize"
      :defineConfig="defineConfig"
    />
</template>

<script>
import MyContent from "@/components/Content.vue";

export default {
  name: "my-customers",
  components: {
    MyContent,
  },
  data() {
    return {
      config: [
        {
          prop: "objectId",
          label: "用户ID",
        },
        {
          prop: "username",
          label: "用户名",
        },
        {
          prop: "phone",
          label: "用户电话",
        },
        {
          prop: "region",
          label: "所在城市",
        },
        {
          prop: "detail",
          label: "详细地址",
        },
      ],
      resData: [],
      totalNumber: 0,
      pageSize: 6,
      defineConfig:{
        searchText:'请输入用户ID',
        isShow:false,
      }
    };
  },
  created() {
    this.getUserList();
  },
  methods: {
    async getUserList() {
      let res = await this.$H.get("/1.1/classes/address");
       res.data.results.forEach((item) => {
          const {
            objectId,
            phone,
            username,
            region,
            detail,
          } = item;
          this.resData.push({
            objectId,
            phone,
            username,
            region,
            detail,
          });
        });
      console.log(this.resData,'==============');
      this.totalNumber = res.data.results.length;
    },
  },
};
</script>

<style scoped>
</style>